#include "pch.h"
#include <vector>
#include <math.h>
using namespace std;
#include "RasterIO.h"
#include "MatrixSF.h"
#pragma once

class FuzzyCMeans
{
public:
	unsigned short ** pLData;
	BOOL Malloc_pLData(CString TifInPath);
	double ** MeanValueMatFCM;
	double **pUData;
	BOOL Initialize(int Times);
	BOOL Malloc_pUData(int iClass);
	BYTE ** pWData;
	BOOL Malloc_pWData(int iClass);
	RasterIO RasterR;
	RasterIO RasterC;
	RasterIO RasterD;
	BOOL Create_RasterC(CString TifOutPath, int iClass);
	RasterIO RasterW;
	float a;
	BYTE ** pCData;
	BOOL ** pPData;
	BOOL FuzzyCMeans_Run(CString TifOutPath, int iHeightNum);
	BOOL UpData_Mean(int iHeightNum);
	BOOL UpData_Mean();
	BOOL UpData_pCData();
	BOOL Release();
	double ** ux;
	BOOL Malloc_UX(int iClass, int iBandNum);
	double u[5];
	double Loss_Function;
	double Loss_Function_Old;
};